import request from '@/utils/request'

export default {
  //列表
  getPageList(page,limit,searchObj){
    return request({
      //接口路径
      url: '/admin/system/user'+"/"+page+"/"+limit,
      method: 'get',
      //参数
      params:searchObj
    })
  },

  //添加
  save(user){
    return request({
      //接口路径
      url: '/admin/system/user/save',
      method: 'post',
      //参数
      data:user
    })
  },

  //根据id查询
  getUserId(id){
    return request({
      //接口路径
      url: '/admin/system/user/getuser/'+id,
      method: 'get',
    })
  },

  //修改
  update(user){
      return request({
        //接口路径
        url: '/admin/system/user/update',
        method: 'post',
        //参数
        data:user
      })
  },

  //删除
  removeById(id){
    return request({
      //接口路径
      url: '/admin/system/user/remove/'+id,
      method: 'delete',
    })
  },

  //更改用户状态
  updateStatus(id,status){
    return request({
      //接口路径
      url: '/admin/system/user/updateStatus/'+id+"/"+status,
      method: 'get',
    })
  }
}
